package response

import (
	"hft/Database/admin"
	"time"
)

// 楼盘详情
type LouPanFrontInfo struct {
	ID             uint        `json:"id"`
	Name           string      `json:"name"`
	Cover          string      `json:"cover"`
	BelongName     string      `json:"belong_name"`
	ReferencePrice int         `json:"reference_price"`
	Years          string      `json:"years"`
	Address        string      `json:"address"`
	Furnish        string      `json:"furnish"`
	Status         int         `json:"status"`
	Longitude      float64     `json:"longitude"`
	Latitude       float64     `json:"latitude"`
	SwipeList      []*Swipe    `json:"swipe_list"`
	Activities     []*Activity `json:"activities"`
	RoomList       []*RoomList `json:"room_list"`
	Property       []*Property `json:"property"`
	AreaInfo       LouArea     `json:"area_info"`
	SellLouPanInfo SellInfo    `json:"info"`
	Tags           []*Tags     `json:"tags"`
	AreaLou        []*Lou      `json:"area_lou"`
	PriceLou       []*Lou      `json:"price_lou"`
}

type Property struct {
	ID   uint   `json:"id"`
	Name string `json:"name"`
}

type SellInfo struct {
	OpenTime    int    `json:"open_time"`
	GetRoomTime int    `json:"get_room_time"`
	Developer   string `json:"developer"`
	SellPhone   string `json:"sell_phone"`
	License     string `json:"license"`
}

type Tags struct {
	Name string `json:"name"`
}

type LouArea struct {
	FloorArea       float32 `json:"floor_area"`
	BuildArea       float32 `json:"build_area"`
	BuildNum        int     `json:"build_num"`
	UserNum         string  `json:"user_num"`
	ParkingSpace    string  `json:"parking_space"`
	VolumeRate      float32 `json:"volume_rate"`
	GreeningRate    float32 `json:"greening_rate"`
	PropertyCost    string  `json:"property_cost"`
	PropertyCompany string  `json:"property_company"`
}

type RoomList struct {
	ID             uint            `json:"id"`
	RoomPayType    int             `json:"room_pay_type"`
	Name           string          `json:"name"`
	Area           int             `json:"area"`
	FirstPay       int             `json:"firstPay" gorm:"comment:几成首付"`
	BathRoom       int             `json:"bathRoom" gorm:"comment:卫"`
	Office         int             `json:"office" gorm:"comment:厅"`
	ReferencePrice int             `json:"referencePrice"`
	PropertyUse    int             `json:"propertyUse" gorm:"comment:物业用途:住宅，公寓，写字楼......"`
	Forward        int             `json:"forward" gorm:"type:tinyint(1);size:1"`
	Cover          string          `json:"cover" gorm:"type:text"`
	Status         int             `json:"status" gorm:"comment:销售状态"`
	RoomId         int             `json:"roomId" gorm:"comment:户型id"`
	RoomType       *admin.RoomType `json:"roomType,omitempty" gorm:"foreignKey:ID;references:RoomId;constraint:OnDelete:SET NULL,OnUpdate:NO ACTION"`
	RoomSwiper     []*RoomSwiper   `json:"roomSwiper" gorm:"foreignKey:RoomID;references:ID;constraint:OnDelete:CASCADE,OnUpdate:CASCADE"`
}

type RoomSwiper struct {
	CategoryName string `json:"category_name"`
	Category     int    `json:"category_id"`
	Cover        string `json:"cover"`
	Url          string `json:"url"`
	GoUrl        string `json:"go_url"`
	RoomID       uint   `json:"-"`
}

type Swipe struct {
	CreateTime   time.Time `json:"create_time"`
	Category     int       `json:"category"`
	Cover        string    `json:"cover"`
	CategoryName string    `json:"category_name"`
	Url          string    `json:"url"`
	Title        string    `json:"title"`
	ID           int       `json:"id"`
	GoUrl        string    `json:"go_url"`
}

type Activity struct {
	ID               uint   `json:"id"`
	Title            string `json:"title"`
	Cont             string `json:"cont"`
	ActivitySub      string `json:"activitySub"`
	Cover            string `json:"cover"`
	Image            string `json:"image"`
	ButtonName       string `json:"buttonName"`
	ButtonColor      string `json:"buttonColor"`
	TextColor        string `json:"textColor"`
	ActivitySubColor string `json:"activitySubColor"`
	BackColor        string `json:"backColor"`
	BorderColor      string `json:"borderColor"`
	Application      int    `json:"application"`
	SuccessButton    string `json:"success_button"`
}

type Lou struct {
	ID             uint                  `json:"id"`
	Name           string                `json:"name"`
	Cover          string                `json:"cover"`
	ReferencePrice int                   `json:"reference_price"`
	Status         int                   `json:"status"`
	BelongName     string                `json:"belong_name"`
	MaxArea        int                   `json:"max_area"`
	MinArea        int                   `json:"min_area"`
	Tags           []*admin.CommonTag    `json:"tags"`
	Disadvantages  []*admin.Disadvantage `json:"disadvantages"`
}
